package com.iipaas.twheel;

/**
 * 任务节点
 * @author chin
 */
public class Task<T> {
    private T data;
    private Task<T> next;
    private Task<T> prev;
    private final long timeout;

    public Task(T data, long timeout, Task<T> next, Task<T> prev) {
        this.data = data;
        this.next = next;
        this.prev = prev;
        this.timeout = timeout;
    }

    public Task(T data, long timeout) {
        this.data = data;
        this.timeout = timeout;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Task<T> getNext() {
        return next;
    }

    public void setNext(Task<T> next) {
        this.next = next;
    }

    public Task<T> getPrev() {
        return prev;
    }

    public void setPrev(Task<T> prev) {
        this.prev = prev;
    }

    public long timeout() {
        return timeout;
    }
}
